﻿<%@ Page Language="C#" MasterPageFile="~/AdminMaster.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="MyWeb.Admins.Users" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server" > 
<div class="PageName"></div>
<asp:Panel ID="pnView" runat="server">
<div class="Control"><ul><li><asp:LinkButton CssClass="vadd" ID="lbtAddT" runat="server" onclick="AddButton_Click">Thêm mới</asp:LinkButton></li> <li><asp:LinkButton CssClass="vdelete" ID="lbtDeleteT" runat="server" onclick="DeleteButton_Click">Xóa</asp:LinkButton></li> <li> <asp:LinkButton CssClass="vrefresh" ID="lbtRefreshT" runat="server" onclick="RefreshButton_Click">Làm mới</asp:LinkButton></li> <li> <a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở lại</a> </li></ul></div>
<asp:Datagrid ID="grdUsers" runat="server" width="100%" CssClass="TableView" AutoGenerateColumns="False" AllowPaging="True" PageSize="20" PagerStyle-Mode="NumericPages" PagerStyle-HorizontalAlign="Center" onitemdatabound="grdUsers_ItemDataBound" onitemcommand="grdUsers_ItemCommand" onpageindexchanged="grdUsers_PageIndexChanged"> <HeaderStyle CssClass="trHeader"></HeaderStyle> <ItemStyle CssClass="trOdd"></ItemStyle> <AlternatingItemStyle CssClass="trEven"></AlternatingItemStyle> <Columns>
<asp:TemplateColumn ItemStyle-CssClass="tdCenter"> <HeaderTemplate> <asp:CheckBox id="chkSelectAll" Runat="server" AutoPostBack="False"></asp:CheckBox> </HeaderTemplate> <ItemTemplate> <asp:CheckBox id="chkSelect" runat="server"></asp:CheckBox> </ItemTemplate> <ItemStyle CssClass="tdCenter"></ItemStyle> </asp:TemplateColumn>
<asp:BoundColumn DataField="uID" HeaderText="uID" Visible="False" />
<asp:BoundColumn DataField="uID" HeaderText="ID" ItemStyle-CssClass="Text" 
        Visible="false" >
    <ItemStyle CssClass="Text" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="dpID" HeaderText="DepartmentID" 
        ItemStyle-CssClass="Text" Visible="false" >
    <ItemStyle CssClass="Text" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="psID" HeaderText="PositionID" ItemStyle-CssClass="Text" 
        Visible="false" >
    <ItemStyle CssClass="Text" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="Code" HeaderText="Mã" ItemStyle-CssClass="Text" 
        Visible="false" >
    <ItemStyle CssClass="Text" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="User" HeaderText="Tên đăng nhập" 
        ItemStyle-CssClass="Text" Visible="true" >
    <ItemStyle CssClass="Text" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="Pass" HeaderText="Mật khẩu" 
        ItemStyle-CssClass="MultiLine" Visible="false" >
    <ItemStyle CssClass="MultiLine" />
    </asp:BoundColumn>
<asp:TemplateColumn ItemStyle-CssClass="Text"> <HeaderTemplate>Tên</HeaderTemplate> <ItemTemplate> <asp:label ID="lblname" runat="server" Text=""></asp:label> </ItemTemplate> 
    <ItemStyle CssClass="Text" />
    </asp:TemplateColumn>
<asp:TemplateColumn ItemStyle-CssClass="DateTime"> <HeaderTemplate>Ngày đăng</HeaderTemplate> <ItemTemplate> <asp:label ID="Label2" runat="server" Text='<%#Eval("Date") %>'></asp:label> </ItemTemplate> 
    <ItemStyle CssClass="DateTime" />
    </asp:TemplateColumn>
<asp:BoundColumn DataField="Add" HeaderText="Add" ItemStyle-CssClass="MultiLine" 
        Visible="true" >
    <ItemStyle CssClass="MultiLine" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="Tel" HeaderText="Điện thoại" ItemStyle-CssClass="Text" 
        Visible="false" >
    <ItemStyle CssClass="Text" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="Ord" HeaderText="Thứ tự" ItemStyle-CssClass="Number" 
        Visible="false" >
    <ItemStyle CssClass="Number" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="Email" HeaderText="Email" ItemStyle-CssClass="Text" 
        Visible="true" >
    <ItemStyle CssClass="Text" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="Admin" HeaderText="Admin" ItemStyle-CssClass="Text" 
        Visible="true" >
    <ItemStyle CssClass="Text" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="Img" HeaderText="ảnh" ItemStyle-CssClass="Image" 
        Visible="false" >
    <ItemStyle CssClass="Image" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="CN" HeaderText="CN" ItemStyle-CssClass="Text" 
        Visible="true" >
    <ItemStyle CssClass="Text" />
    </asp:BoundColumn>
<asp:BoundColumn DataField="canAccept" HeaderText="CanAccept" 
        ItemStyle-CssClass="Text" Visible="true" >
    <ItemStyle CssClass="Text" />
    </asp:BoundColumn>
<asp:TemplateColumn ItemStyle-CssClass="Function"> <HeaderTemplate>Chức năng</HeaderTemplate> <ItemTemplate><asp:ImageButton ID="cmdAddSub" runat="server" AlternateText="Thêm cấp con" CommandName="AddSub" CssClass="Add" ToolTip="Thêm cấp con" ImageUrl="/App_Themes/Admin/images/add.png" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Level")%>'/><asp:ImageButton ID="cmdEdit" runat="server" AlternateText="Sửa" CommandName="Edit" CssClass="Edit" ToolTip="Sửa" ImageUrl="/App_Themes/Admin/images/edit.png" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"uID")%>' />
    <asp:ImageButton ID="viewConTract" runat="server" AlternateText="Quản lý hợp đồng" 
      CommandArgument='<%#DataBinder.Eval(Container.DataItem,"uID")%>' 
        CommandName="ConTract"    CssClass="Add" ImageUrl="/App_Themes/Admin/images/play_green.png" 
        ToolTip="Quản lý hợp đồng" />
            <asp:ImageButton ID="viewwork" runat="server" AlternateText="Quản lý công việc" 
      CommandArgument='<%#DataBinder.Eval(Container.DataItem,"uID")%>' 
        CommandName="work"    CssClass="Add" ImageUrl="/App_Themes/Admin/images/icon_billing.jpg" 
        ToolTip="Quản lý công việc" />
    <asp:ImageButton ID="cmdDelete" runat="server" AlternateText="Xóa" CommandName="Delete" CssClass="Delete" ToolTip="Xóa" ImageUrl="/App_Themes/Admin/images/delete.png" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"uID")%>' OnClientClick="javascript:return confirm('Bạn có muốn xóa?');" /></ItemTemplate> 
    <ItemStyle CssClass="Function" />
    </asp:TemplateColumn>
</Columns><PagerStyle HorizontalAlign="Center" CssClass="Paging" Position="Bottom" NextPageText="Previous" PrevPageText="Next" Mode="NumericPages"></PagerStyle></asp:Datagrid>
<div class="Control"><ul><li><asp:LinkButton CssClass="vadd" ID="lbtAddB" runat="server" onclick="AddButton_Click">Thêm mới</asp:LinkButton></li> <li><asp:LinkButton CssClass="vdelete" ID="lbtDeleteB" runat="server" onclick="DeleteButton_Click">Xóa</asp:LinkButton></li> <li><asp:LinkButton CssClass="vrefresh" ID="lbtRefreshB" runat="server" onclick="RefreshButton_Click">Làm mới</asp:LinkButton></li> <li> <a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở lại</a> </li></ul></div>
</asp:Panel>
<asp:Panel ID="pnUpdate" runat="server" Visible="False">
<table class="TableUpdate" border="1">
<tr> <td class="Control" colspan="2"><ul><li><asp:LinkButton CssClass="uupdate" ID="lbtUpdateT" runat="server" onclick="Update_Click">Ghi lại</asp:LinkButton></li> <li> <asp:LinkButton CssClass="uback" ID="lbtBackT" runat="server" onclick="Back_Click" CausesValidation="False">Trở về</asp:LinkButton></li> </ul></td> </tr>
<tr> <th> <asp:Label ID="lbldpID" runat="server" Text="DepartmentID:"></asp:Label></th><td>
    <asp:DropDownList ID="ddlDepartment" runat="server">
    </asp:DropDownList>
    </td></tr>
<tr> <th> <asp:Label ID="Label3" runat="server" Text="PaID:"></asp:Label></th><td>
    <asp:DropDownList ID="ddlPart" runat="server">
    </asp:DropDownList>
    </td></tr>
<tr> <th> <asp:Label ID="lblpsID" runat="server" Text="PositionID:"></asp:Label></th><td>
    <asp:DropDownList ID="ddlPosition" runat="server">
    </asp:DropDownList>
    </td></tr><tr> <th> <asp:Label ID="lblCode" runat="server" Text="Mã:"></asp:Label></th><td><asp:TextBox ID="txtCode" runat="server" CssClass="text"></asp:TextBox></td></tr><tr> <th> <asp:Label ID="lblUser" runat="server" Text="Tên đăng nhập:"></asp:Label></th><td><asp:TextBox ID="txtUser" runat="server" CssClass="text"></asp:TextBox></td></tr><tr> <th> <asp:Label ID="lblPass" runat="server" Text="Mật khẩu:"></asp:Label></th><td><asp:TextBox ID="txtPass" runat="server" CssClass="text multiline" TextMode="MultiLine"></asp:TextBox></td></tr><tr> <th> <asp:Label ID="lblName" runat="server" Text="Tên:"></asp:Label></th><td><asp:TextBox ID="txtName" runat="server" CssClass="text"></asp:TextBox><asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName" Display="Dynamic" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator></td></tr><tr> <th> <asp:Label ID="lblDate" runat="server" Text="Ngày đăng:"></asp:Label></th><td><asp:TextBox ID="txtDate" runat="server" CssClass="text datetime"/><asp:MaskedEditExtender ID="meeDate" runat="server" Mask="99/99/9999 99:99:99" MaskType="DateTime" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" TargetControlID="txtDate" AcceptAMPM="True" Century="2000"/> <asp:MaskedEditValidator ID="mevDate" runat="server" ControlExtender="meeDate" ControlToValidate="txtDate" Display="Dynamic" EmptyValueBlurredText="Date and time is required" IsValidEmpty="True" InvalidValueBlurredMessage="Date and time is invalid" SetFocusOnError="True"/></td></tr><tr> <th> <asp:Label ID="lblAdd" runat="server" Text="Add:"></asp:Label></th><td><asp:TextBox ID="txtAdd" runat="server" CssClass="text multiline" TextMode="MultiLine"></asp:TextBox></td></tr><tr> <th> <asp:Label ID="lblTel" runat="server" Text="Điện thoại:"></asp:Label></th><td><asp:TextBox ID="txtTel" runat="server" CssClass="text"></asp:TextBox></td></tr><tr> <th> <asp:Label ID="lblOrd" runat="server" Text="Thứ tự:"></asp:Label></th><td><asp:TextBox ID="txtOrd" runat="server" CssClass="text number"/><asp:RequiredFieldValidator ID="rfvOrd" runat="server" ControlToValidate="txtOrd" Display="Dynamic" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator></td></tr><tr> <th> <asp:Label ID="lblEmail" runat="server" Text="Email:"></asp:Label></th><td><asp:TextBox ID="txtEmail" runat="server" CssClass="text"></asp:TextBox></td></tr><tr> <th> <asp:Label ID="lblAdmin" runat="server" Text="Admin:"></asp:Label></th><td><asp:TextBox ID="txtAdmin" runat="server" CssClass="text"></asp:TextBox></td></tr><tr> <th> <asp:Label ID="lblImg" runat="server" Text="ảnh:"></asp:Label></th><td><asp:TextBox ID="txtImg" runat="server" CssClass="text image"></asp:TextBox>&nbsp;<input ID="btnImgImg" type="button" onclick="BrowseServer('<% =txtImg.ClientID %>','Images');" value="Browse Server" />&nbsp; <asp:Image ID="imgImg" runat="server" ImageAlign="Middle" Width="100px" /></td></tr><tr> <th> <asp:Label ID="lblCN" runat="server" Text="CN:"></asp:Label></th><td><asp:TextBox ID="txtCN" runat="server" CssClass="text"></asp:TextBox></td></tr><tr> <th> <asp:Label ID="lblcanAccept" runat="server" Text="CanAccept:"></asp:Label></th><td><asp:TextBox ID="txtcanAccept" runat="server" CssClass="text"></asp:TextBox></td></tr><tr> <td class="Control" colspan="2"><ul><li><asp:LinkButton CssClass="uupdate" ID="lbtUpdateB" runat="server" onclick="Update_Click">Ghi lại</asp:LinkButton></li> <li> <asp:LinkButton CssClass="uback" ID="lbtBackB" runat="server"  onclick="Back_Click" CausesValidation="False">Trở về</asp:LinkButton></li> </ul></td> </tr></table>
</asp:Panel>
</asp:Content>
